package cn.iocoder.yudao.module.system.factory;

import cn.iocoder.yudao.module.system.service.file_storage.UploadService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author zyk
 */
@Component
public class UploadFactory {

    @Resource
    private List<UploadService> uploadServiceList;

    public UploadService get(String type){
        return uploadServiceList.stream().filter(t -> t.accept(type)).findAny().get();
    }
}
